Fix multi-hunk serialization bug, clippy warnings, and documentation issues#1
Merged
Merged
Conversation
…issues Bug fix: - Fix Vec<Hunk<T>>::to_patch() concatenating hunks without newline separator, producing invalid unified diff format (e.g. ' d@@ -6,4 +6,4 @@') Clippy fixes: - Replace if/else if chain with match + cmp in apply() (comparison_chain) - Replace redundant closures with method references (redundant_closure_for_method_calls) - Add missing semicolons in traceback() (semicolon_if_nothing_returned) - Remove unnecessary semicolon in HunkBuilder::process() - Replace wildcard import with explicit imports in diffable.rs Documentation fixes: - Fix broken rustdoc links: Hunk -> patch::Hunk, Change -> recursive::Change - Add backticks around Edit::Equal in Hunk doc comment (doc_markdown) - Add backticks around PatchError in apply() doc comment - Add # Errors section to apply() and FromPatch::from_patch() docs Tests: - Add test_multi_hunk_patch_format to verify @@ headers are on their own line - Add test_multi_hunk_roundtrip to verify serialize/deserialize with multiple hunks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug fix:
Clippy fixes:
Documentation fixes:
Tests: